package cn.home.fenni.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.home.fenni.mapper.HomeServicePackageMapper;
import cn.home.fenni.domain.HomeServicePackage;
import cn.home.fenni.service.IHomeServicePackageService;

/**
 * 服务包Service业务层处理
 * 
 * @author homedoctor
 * @date 2025-04-09
 */
@Service
public class HomeServicePackageServiceImpl implements IHomeServicePackageService 
{
    @Autowired
    private HomeServicePackageMapper homeServicePackageMapper;

    /**
     * 查询服务包
     * 
     * @param packageId 服务包主键
     * @return 服务包
     */
    @Override
    public HomeServicePackage selectHomeServicePackageByPackageId(Long packageId)
    {
        return homeServicePackageMapper.selectHomeServicePackageByPackageId(packageId);
    }

    /**
     * 查询服务包列表
     * 
     * @param homeServicePackage 服务包
     * @return 服务包
     */
    @Override
    public List<HomeServicePackage> selectHomeServicePackageList(HomeServicePackage homeServicePackage)
    {
        return homeServicePackageMapper.selectHomeServicePackageList(homeServicePackage);
    }

    /**
     * 新增服务包
     * 
     * @param homeServicePackage 服务包
     * @return 结果
     */
    @Override
    public int insertHomeServicePackage(HomeServicePackage homeServicePackage)
    {
        return homeServicePackageMapper.insertHomeServicePackage(homeServicePackage);
    }

    /**
     * 修改服务包
     * 
     * @param homeServicePackage 服务包
     * @return 结果
     */
    @Override
    public int updateHomeServicePackage(HomeServicePackage homeServicePackage)
    {
        return homeServicePackageMapper.updateHomeServicePackage(homeServicePackage);
    }

    /**
     * 批量删除服务包
     * 
     * @param packageIds 需要删除的服务包主键
     * @return 结果
     */
    @Override
    public int deleteHomeServicePackageByPackageIds(Long[] packageIds)
    {
        return homeServicePackageMapper.deleteHomeServicePackageByPackageIds(packageIds);
    }

    /**
     * 删除服务包信息
     * 
     * @param packageId 服务包主键
     * @return 结果
     */
    @Override
    public int deleteHomeServicePackageByPackageId(Long packageId)
    {
        return homeServicePackageMapper.deleteHomeServicePackageByPackageId(packageId);
    }

    @Override
    public List<String> getTagsByPackageId(Long packageId) {
        return homeServicePackageMapper.selectTags(packageId);
    }
}
